package com.example.itces.utils;

import java.io.Serializable;

public class ResponData implements Serializable{
    private Integer res=0;// 操作状态
    private String msg;// 返回信息
    private Object data; // 返回数据

    public ResponData(Integer res, String msg, Object data) {
        this.res = res;
        this.msg = msg;
        this.data = data;
    }

    public ResponData() {
    }

    public ResponData(Object data) {
        res=1;
        this.data = data;
    }

    public static ResponData ok(Object data){
        return new ResponData(data);
    }
    public static ResponData ok(){
        return new ResponData(null);
    }

    public static ResponData build(Integer res,String msg){

        return new ResponData(res,msg,null);
    }
    public static ResponData build(Integer res,String msg,Object data){

        return new ResponData(res,msg,data);
    }






    public Integer getRes() {
        return res;
    }

    public void setRes(Integer res) {
        this.res = res;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "ResponData{" +
                "res=" + res +
                ", msg='" + msg + '\'' +
                ", data=" + data +
                '}';
    }
}
